/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.    
 */

using System;
using Velocity4Net.Runtime.Directives;
using Velocity4Net.Runtime.Parse;
namespace Velocity4Net.Errors
{
    /**
     * Exception generated to indicate parse errors caught during
     * directive initialization (e.g. wrong number of arguments)
     *
     * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
     * @version $Id: TemplateInitException.java 685685 2008-08-13 21:43:27Z nbubna $
     * @since 1.5
     */
    public class TemplateInitException : VelocityException, ExtendedParseException
    {
        private readonly String templateName;
        private readonly int col;
        private readonly int line;

        public TemplateInitException(String msg,
                 String templateName, int col, int line)
            : base(msg)
        {
            this.templateName = templateName;
            this.col = col;
            this.line = line;
        }

        public TemplateInitException(String msg, ParseException parseException,
                 String templateName, int col, int line)
            : base(msg, parseException)
        {

            this.templateName = templateName;
            this.col = col;
            this.line = line;
        }

        /**
         * Returns the Template name where this exception occured.
         * @return the template name
         */
        public String TemplateName
        {
            get
            {
                return templateName;
            }
        }

        /**
         * Returns the line number where this exception occured.
         * @return the line number
         */
        public int LineNumber
        {
            get
            {
                return line;
            }
        }

        /**
         * Returns the column number where this exception occured.
         * @return the line number
         */
        public int ColumnNumber
        {
            get
            {
                return col;
            }
        }




    }
}